home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1999 #2 / Amiga Plus CD - 1999 - No. 2.iso / Anwender / Office / AmigaWriter / Patches / AW1.02-GermanSpecial.lha / AmigaWriter-1st_Patch / Tools / source / bumprev.srx < prev    next >
Text File  |  1998-09-23  |  2KB  |  58 lines

  1. /*
  2.     bumprev.srx
  3.  
  4.     Bump revision
  5.  
  6.     © 1998 HAAGE & PARTNER GmbH
  7.  
  8.     Create a new empty file and attach this make script to it. After the
  9.     first make this file contains version 1. Touch this file if you want
  10.     a new revision set. Change the version number if you want to increase
  11.     it. In this case you should edit the file "xxx_rev.rev" and set the
  12.     revision number to 0.
  13.  
  14.     Warning: this make script overwrites its file if the first line does
  15.              not contain a single number.
  16.  
  17.     $VER bumprev.srx 2.0 (9.3.98)
  18. */
  19.  
  20. /* Don't forget the point '.' at the end      \/        */
  21. PARSE ARG '"' filename '"' '"' projectname '"' .
  22.  
  23. revname = LEFT(filename,LASTPOS('_ver.txt',filename)-1)
  24.  
  25. SAY ""
  26. SAY "Bumping revision..."
  27.  
  28. found = 0
  29. IF OPEN(vfile,filename,"Read") == 1 THEN DO
  30.     version = READLN(vfile)
  31.     IF DATATYPE(version,"Whole") THEN
  32.         found = 1
  33.     CALL CLOSE(vfile)
  34.     END
  35. IF ~found THEN DO
  36.     SAY "Version not found - generating new version file"
  37.     IF OPEN(vfile,filename,"Write") == 1 THEN DO
  38.         CALL WRITELN(vfile,"1")
  39.         CALL WRITELN(vfile,"* The first line contains the version number")
  40.         CALL WRITELN(vfile,"* If you change this you should also edit the file")
  41.         CALL WRITELN(vfile,"* "||revname||"_rev.rev and set the revision")
  42.         CALL WRITELN(vfile,"* number to 0.")
  43.         CALL WRITELN(vfile,"")
  44.         CALL WRITELN(vfile,"* Touch this file if you want to set a new revision number")
  45.         CALL CLOSE(vfile)
  46.         END
  47.     ELSE DO
  48.         SAY "Unable to create version file "||filename||"."
  49.         EXIT 20
  50.         END
  51.     version = 1
  52.     END
  53.  
  54. ADDRESS COMMAND "bumprev" version revname
  55. OBJECTS filename revname||"_rev.h" revname||"_rev.i"
  56.  
  57. SAY "Done."
  58.